fix(workflows): authorize agent wake via workflow-owner tag - #5048
fix(workflows): authorize agent wake via workflow-owner tag#5048joaoh82 wants to merge 2 commits into
Conversation
Recognize relay-authored workflow events through the relay's NIP-11 identity, then apply the existing inbound author policy to their attributed owner. Keep malformed, forged, and non-workflow events fail-closed on the raw signer. Co-authored-by: Joao Henrique Machado Silva <joaoh82@gmail.com> Signed-off-by: Joao Henrique Machado Silva <joaoh82@gmail.com>
|
Live verification invalidated the root-cause assumption behind this patch. Setting the target agent access mode to |
Relay-signed send_message events were dropped by ACP's owner-only author gate because the raw signer is the relay, not the workflow owner. Live events also only carry a mention `p` tag, so treating the first `p` as authority is incorrect. Emit a dedicated workflow-owner authority tag from the relay sink, and have ACP accept that principal only for NIP-11 self-signed kind-9 events with exactly one buzz:workflow=true marker. Mention `p` tags stay routing-only and cannot grant authority. Co-authored-by: Joao Henrique Machado Silva <joaoh82@gmail.com> Signed-off-by: Joao Henrique Machado Silva <joaoh82@gmail.com>
Investigation update (2026-08-07)Follow-up after the live falsification note on the previous head. What was wrong with the previous patchHead There is no separate owner Why the live
|
Summary
workflow-ownerauthority tag on relay-signed workflowsend_messageeventsself, and carries exactly onebuzz:workflow=truemarker plus one validworkflow-ownertagptags as routing only — they never grant author-gate authorityRoot cause
Scheduled workflow
send_messagepublishes valid kind-9 events signed by the relay service. ACP's inbound author gate previously evaluated that raw relay signer, so defaultowner_onlyagents dropped the message before mention matching. Human-authored mentions worked because their raw signer already passed the policy.An earlier draft of this PR tried to derive authority from the first
ptag. That is wrong: live production events often carry only the mentioned agent asp(and for agent-owned workflows that is the agent itself). Authority must not be inferred from mention routing tags.A live
Anyonecheck appeared to falsify the author-gate diagnosis, but Desktop can fail to persistrespond_toedits to the harness process (#2501). Independent reports show workflow messages do wake when the harness actually starts withrespond_to=anyone. The production harness still runs stock code without this patch.Tracked by
#3858. Design aligns with the authority contract proposed in#2737/#3638(dedicated owner tag;pfor mentions only).Impact
Trusted scheduled workflows can wake the intended agent under normal
owner_onlypolicy without weakening the general inbound author gate or treating mentionptags as authority.Deploy note
This is a two-component fix: the relay must emit
workflow-owner, and ACP must accept it. Existing in-channel workflow events without the tag remain fail-closed until new events are published after relay deploy.Validation
cargo test -p buzz-acp(697 unit + 9 integration) at7653c00e23c598ea44177da5338ba99b6faaf80acargo test -p buzz-relay --lib workflow_sink(17 passed, 1 ignored postgres)cargo clippy -p buzz-acp --all-targets -- -D warningsat the same commitSecurity properties
selfpubkeybuzz:workflow=truemarkerworkflow-ownerpubkeyptags never grant authority